import { DictStorage } from "@/storage/dict.storage";

export const getPaymentAsset = (url: string) => {
  return new URL(`../../../assets/payment/${url}`, import.meta.url).href;
};

export const getPaymentMethodName = (method: string) => {
  const paymentMethodNames = DictStorage.getDictItemsByCode(
    "pos_tradein_payment_method"
  );

  const target = paymentMethodNames.find((item: any) => item.value === method);
  if (target) {
    return target.label;
  }
  return "/";
};
